package net.csdn.business.common.domain.request;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.csdn.business.common.domain.issue.IssueExt;
import net.csdn.business.common.domain.validation.groups.System;
import net.csdn.business.common.enums.UserTypeEnum;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * @author lAln
 * @date 2022/6/14 18:33
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class IssueUpdateReqDto implements Serializable {
    @NotBlank(message = "issueId 不合法")
    private String issueId;

    @Length(min = 24, max = 24, message = "assignUser 不合法")
    private String assignUser;

    @Length(min = 1, max = 200, message = "标题不能超过 200 个字符")
    private String title;

    @Range(min = 0, max = 1, message = "lock 不合法")
    private Integer lock;

    @Range(min = 0, max = 1, message = "pin 不合法")
    private Integer pin;

    @Range(min = 0, max = 1, message = "label 不合法")
    private Integer label;

    @Length(min = 24, max = 24, message = "milepostId 不合法")
    private String milepostId;

    @NotBlank(message = "uid 不合法", groups = {System.class})
    private String uid;

    /**
     * {@link net.csdn.business.common.enums.UserTypeEnum}
     */
    private Integer userType = UserTypeEnum.USER.getType();

    private IssueExt ext;
    /**
     * issue 主体
     */
    private String content;
    private String mdContent;
    private Boolean isSyncKanban = true;
    private Boolean migrateFlag = false;
    private Date createdDate;
    private Date updatedDate;
    private Date closedDate;

}
